package cn.itcast.order.feign;



import cn.itcast.order.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "userservice",fallback = UserFeignClientImpl.class)  //这里的value是user-service的服务id
public interface UserFeignClient {

    @GetMapping("/user/{id}")  //这里的返回结果和 url地址一定要和提供方保持一致
    User findById(@PathVariable("id") Long id);
}
